
compiler_plugin "FS.Plugins.Ext.WithEach"
{
    desc            =   "Allows looping over a collection with 'with' functionality to avoid prefixing the element name";
    examples        =   [ 'var users = getUsers(); with each user { print ( name, age, isactive ); }'  ];
    type            =   "expr";
    precedence      =   1;  
    grammar_match   =   "$start:@starttoken each $name:@singularsymbol.tvaluestring";
	grammar_parse	= 	"#buildexpr:@expr.block";
	start_tokens	=   [ "with" ];
    build           =   function(args)    
                        {       
							var collectionName = args["nameValue"] + 's';
                            return sys.compiler.toEnumerableLoop(args["nameValue"], true, args["start"]);
                        }
}